# 基础镜像
# FROM cgr.dev/chainguard/wolfi-base as base
FROM docker.linkos.org/library/alpine as base


# 设置时区
ENV TZ=Asia/Shanghai

# 设置工作目录
WORKDIR /fbserver

# 将代码复制到容器中
COPY store ./store
COPY upload ./upload
COPY fb_deploy.sh .


# npm config set registry https://registry.npmmirror.com  && \ nodejs && apk del --purge curl && \
# 替换aliyun源，并更新
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
    apk update && apk add --no-cache curl bash && \
    sh fb_deploy.sh && rm -rf fb_deploy.sh && \
    apk del --purge curl bash && \
    rm -rf /var/cache/* /tmp/* /var/tmp/* /var/lib/apt/lists/* /usr/share/doc/* /name/usr/share/man/* /usr/share/info/*

# 启动命令
CMD [ "./fireboom", "start", "--enable-web-console=false" ]

# 暴露端口
EXPOSE 9991
# EXPOSE 9992


# 指定挂载目录
# VOLUME /fbserver/log
# VOLUME /fbserver/store
# VOLUME /fbserver/template
# VOLUME /fbserver/upload
# VOLUME /fbserver/custom-go
# VOLUME /fbserver/custom-ts
